package com.application.common;

import org.apache.log4j.Level;
import org.apache.log4j.Logger;

public class BaseLogger {
	private static Logger logger = Logger.getLogger(BaseLogger.class.getName());  
    public static void writeLog(String type,Object objMsg){
    	if("a".equals(type.toLowerCase())){
    		logger.log(BaseLogger.class.getName(),Level.ALL, objMsg,null);
    	}else if("d".equals(type.toLowerCase())){
    		logger.log(BaseLogger.class.getName(),Level.DEBUG, objMsg,null);
    	}else if("i".equals(type.toLowerCase())){
    		logger.log(BaseLogger.class.getName(),Level.INFO, objMsg,null);
    	}else if("w".equals(type.toLowerCase())){
    		logger.log(BaseLogger.class.getName(),Level.WARN, objMsg,null);
    	}else if("e".equals(type.toLowerCase())){
    		logger.log(BaseLogger.class.getName(),Level.ERROR, objMsg,null);
    	}else if("f".equals(type.toLowerCase())){
    		logger.log(BaseLogger.class.getName(),Level.FATAL, objMsg,null);
    	}else{
    		logger.log(BaseLogger.class.getName(),Level.OFF, objMsg,null);
    	}     	
    }
    
    public static void writeAllLog(Object objMsg){
    	logger.log(BaseLogger.class.getName(),Level.ALL, objMsg,null);
    }
    
    public static void writeDebugLog(Object objMsg){
    	logger.log(BaseLogger.class.getName(),Level.DEBUG, objMsg,null);
    }
    
    public static void writeInfoLog(Object objMsg){
    	logger.log(BaseLogger.class.getName(),Level.INFO, objMsg,null);
    }
    
    public static void writeWarnLog(Object objMsg){
    	logger.log(BaseLogger.class.getName(),Level.WARN, objMsg,null);
    }
    
    public static void writeErrorLog(Object objMsg){
    	logger.log(BaseLogger.class.getName(),Level.ERROR, objMsg,null);
    }
    
    public static void writeFatalLog(Object objMsg){
    	logger.log(BaseLogger.class.getName(),Level.FATAL, objMsg,null);
    }
    
    public static void writeOffLog(Object objMsg){
    	logger.log(BaseLogger.class.getName(),Level.OFF, objMsg,null);
    }
}
